package top.easyblog.core.atomic;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.easyblog.core.dao.auto.mapper.MappingVisitRecordMapper;
import top.easyblog.core.dao.auto.model.MappingVisitRecord;
import top.easyblog.core.util.JsonUtils;

import java.util.Date;

/**
 * @author: frank.huang
 * @date: 2023-12-30 17:31
 */
@Slf4j
@Service
public class AtomicMappingVisitRecordService {

    @Autowired
    private MappingVisitRecordMapper mapper;


    public void insertOne(MappingVisitRecord record) {
        record.setCreateTime(new Date());
        record.setUpdateTime(new Date());
        mapper.insertSelective(record);
        log.info("[DB]Insert new MappingVisitRecord:{}", JsonUtils.toJSONString(record));
    }


}
